music_table_all = \
(
    ("0:0=1/4",),
	("1--:2--:3--:4--:5--:6--:7--=1/4", ),
	("1-:2-:3-:4-:5-:6-:7-=1/4",),
	("1:2:3:4:5:6:7=1/4",),
	("1+:2+:3+:4+:5+:6+:7+=1/4",),
	("1++:2++:3++:4++:5++:6++:7++=1/4",),
    ("1+++:1+++=1/4", ),

	("1--#:2--#:4--#:5--#:6--#=1/4",),
	("1-#:2-#:4-#:5-#:6-#=1/4",),
	("1#:2#:4#:5#:6#=1/4",),
	("1+#:2+#:4+#:5+#:6+#=1/4",),
	("1++#:2++#:4++#:5++#:6++#=1/4",),
)

music_white = \
(
    ("0:0=1/4",),
	("1--:2--:3--:4--:5--:6--:7--=1/4", ),
	("1-:2-:3-:4-:5-:6-:7-=1/4",),
	("1:2:3:4:5:6:7=1/4",),
	("1+:2+:3+:4+:5+:6+:7+=1/4",),
	("1++:2++:3++:4++:5++:6++:7++=1/4",),
    ("1+++:1+++=1/4", ),
)

music_black = \
(
    ("0:0"),
	("1--#:2--#:4--#:5--#:6--#=1/4",),
	("1-#:2-#:4-#:5-#:6-#=1/4",),
	("1#:2#:4#:5#:6#=1/4",),
	("1+#:2+#:4+#:5+#:6+#=1/4",),
	("1++#:2++#:4++#:5++#:6++#=1/4",),
)

music_table = \
(
    ("1:1:1:1:1:1:1:1:1:1=1/16",),
)


import sys
sys.path.append('../../src')
if __name__ == "__main__":
    import piano.music_translate as music_translate
    music_parse = music_translate.music_trans([music_table_all], beat = 240)
    music_parse.music_to_play_table()
    music_parse.play_music()

# import 一千个伤心的理由
# import 那个夏天
# import 亡靈序曲
# import 克罗地亚狂想曲
# import 卡农
# import 晴天
# import 梦中的婚礼
# import 野蜂飞舞.py

# music_table1 = \
# (
#     ("0", "0"),
# 	("6#", "6#", "6#", "6#", "6#", "6#", "6#", "6#"),
# 	("1", "1", "1", "1", "1", "1", "1", "1"),
# )
# music_white = (("2++","3++", "4++"),)
# import music_translate2 as music_translate
# music_parse = music_translate.music_trans([music_table1], beat=120)
# music_parse.music_to_play_table()
# music_parse.play_music()
# while 1:
# 	music_parse.servos.run_single_servo(0, 90)
# 	time.sleep(1)
# 	music_parse.servos.run_single_servo(0, 30)
# 	time.sleep(1)

# music_parse.servos.run_single_servo(32, 70)
# time.sleep(1)
# music_parse.servos.run_single_servo(32, 100)
